Title Banner

Technical Q&A's

OPS 14 - Determining if a 680x0 program is Running on a PPC (27-September-96)


Q How do I determine if my 68K program is running on a PPC?



A The best way to do this is to use the Gestalt Selectors as described in the Universal Interface file Gestalt.h:

enum {
	gestaltSysArchitecture = 'sysa',/* Native System Architecture */
	gestalt68k	= 1,	/* Motorola MC68k architecture */
	gestaltPowerPC	= 2/* IBM PowerPC architecture */
};
 

A snippet of code that uses this could look something like this in your 68K program:

#include 
#include 
#include 
     long myattr;
    OSErr err;
  	err = Gestalt( gestaltSysArchitecture, &myattr;);
 	if (err == noErr) {
		if (myattr == gestaltPowerPC) {
			InstallExtraPPCComp();
		}
	} else {
		// handle error condition
	}
 



Technical Support
Technical Q&A's
Previous Question | Contents

Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help